package com.wicket.okrbff.web.contorller;

import com.wicket.okrbff.biz.service.UserService;
import com.wicket.okrbff.biz.service.dto.req.*;
import com.wicket.okrbff.biz.service.dto.res.*;
import com.wicket.okrbff.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.wicket.okrframework.integration.FwBaseUserClient;
import com.wicket.okrframework.integration.dto.QueryPersonalInformationDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryPersonalInformationDetailReqDto;
import com.wicket.okrbff.common.exception.Assert;
import com.wicket.okrbff.common.util.CommonFunctionHelper;
import com.wicket.okrframework.integration.dto.UpdateUserInfoRespDto;
import com.wicket.okrframework.integration.dto.UpdateUserInfoReqDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoDetailReqDto;
import com.wicket.okrframework.integration.FwBaseMemberClient;
import com.wicket.okrframework.integration.dto.QueryBeginMemberListRespDto;
import com.wicket.okrframework.integration.dto.QueryBeginMemberListReqDto;
import com.wicket.okrframework.integration.FwBaseDivineDataClient;
import com.wicket.okrframework.integration.dto.BatchClearUserInfoFromRedisRespDto;
import com.wicket.okrframework.integration.dto.BatchClearUserInfoFromRedisReqDto;
import java.util.stream.Collectors;
import com.wicket.okrframework.integration.dto.ClearUserInfoFromRedisRespDto;
import com.wicket.okrframework.integration.dto.ClearUserInfoFromRedisReqDto;
import com.wicket.okrframework.integration.dto.ClearTokenFromRedisRespDto;
import com.wicket.okrframework.integration.dto.ClearTokenFromRedisReqDto;
import com.wicket.okrframework.integration.FwBaseCaptchaClient;
import com.wicket.okrframework.integration.dto.UpdateChangePhoneRespDto;
import com.wicket.okrframework.integration.dto.UpdateChangePhoneReqDto;
import com.wicket.okrframework.integration.dto.AddRenewUserInfoRespDto;
import com.wicket.okrframework.integration.dto.AddRenewUserInfoReqDto;
import com.wicket.okrframework.integration.dto.QueryBeginMemberListBorderRespDto;
import com.wicket.okrframework.integration.dto.QueryBeginMemberListBorderReqDto;
import com.wicket.okrframework.integration.dto.QueryUserDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryUserDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryUsersUnionDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryUsersUnionDetailReqDto;
import com.wicket.okrbff.biz.service.dto.common.BffUsersUnionDto;
import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrframework.integration.FwBaseBaseClient;
import com.wicket.okrframework.integration.FwBaseBusinessObjectClient;
import com.wicket.okrframework.integration.dto.QueryAppDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryAppDetailReqDto;
import com.wicket.okrframework.integration.dto.UserLoginRespDto;
import com.wicket.okrframework.integration.dto.UserLoginReqDto;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComRespDto;
import com.wicket.okrframework.integration.dto.QuerySpaceDetailComReqDto;
import com.wicket.okrframework.integration.dto.QueryPublicInfoDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryPublicInfoDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryUserLoginInfoRespDto;
import com.wicket.okrframework.integration.dto.QueryUserLoginInfoReqDto;
import com.wicket.okrframework.integration.dto.AddUsersUnionRespDto;
import com.wicket.okrframework.integration.dto.AddUsersUnionReqDto;
import com.wicket.okrframework.integration.dto.CheckLoginNumberRespDto;
import com.wicket.okrframework.integration.dto.CheckLoginNumberReqDto;
import java.util.concurrent.Callable;
import com.wicket.okrbff.common.exception.BizException;
import com.wicket.okrframework.integration.dto.ChangePublicInfoFromRedisRespDto;
import com.wicket.okrframework.integration.dto.ChangePublicInfoFromRedisReqDto;
import com.wicket.okrframework.integration.dto.PutPublicFieldCacheComRespDto;
import com.wicket.okrframework.integration.dto.PutPublicFieldCacheComReqDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoByLoginDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoByLoginDetailReqDto;
import com.wicket.okrframework.integration.dto.CheckCaptchaValidRespDto;
import com.wicket.okrframework.integration.dto.CheckCaptchaValidReqDto;
import com.wicket.okrframework.integration.dto.QueryAppforLoginDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryAppforLoginDetailComReqDto;
import com.wicket.okrframework.integration.dto.ImplementSignIncheckProcessingDataComRespDto;
import com.wicket.okrframework.integration.dto.ImplementSignIncheckProcessingDataComReqDto;
import com.wicket.okrframework.integration.dto.QueryUserPwdProblemDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryUserPwdProblemDetailReqDto;
import com.wicket.okrframework.integration.dto.QueryUserPwdProblemDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryUserPwdProblemDetailComReqDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryUserInfoDetailComReqDto;
import com.wicket.okrframework.integration.dto.ObtainSpaceThirdPartyAuthenticationConfInfoComRespDto;
import com.wicket.okrframework.integration.dto.ObtainSpaceThirdPartyAuthenticationConfInfoComReqDto;
import com.wicket.okrframework.integration.dto.ImplementAuthLoginOutComRespDto;
import com.wicket.okrframework.integration.dto.ImplementAuthLoginOutComReqDto;
import com.wicket.okrframework.integration.dto.ImplementLoginComRespDto;
import com.wicket.okrframework.integration.dto.ImplementLoginComReqDto;
import com.wicket.okrcomponent.integration.FwCompMessageClient;
import com.wicket.okrcomponent.integration.dto.ImplementInitializationMessageLocationByLoginComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementInitializationMessageLocationByLoginComReqDto;
import com.wicket.okrframework.integration.dto.QueryObtainUnifiedAuthenticationLoginInformationDetailComRespDto;
import com.wicket.okrframework.integration.dto.QueryObtainUnifiedAuthenticationLoginInformationDetailComReqDto;
import com.wicket.okrframework.integration.dto.QueryAuthAccountInfoDetailRespDto;
import com.wicket.okrframework.integration.dto.QueryAuthAccountInfoDetailReqDto;
import com.wicket.okrcomponent.integration.dto.ImplementRealTimeUpdateMsgLocationPushComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementRealTimeUpdateMsgLocationPushComReqDto;
import com.wicket.okrcomponent.integration.FwCompInterfaceModeClient;
import com.wicket.okrcomponent.integration.dto.ImplementFieldsNameAndValueToOneDatasComRespDto;
import com.wicket.okrcomponent.integration.dto.ImplementFieldsNameAndValueToOneDatasComReqDto;
import com.wicket.okrcomponent.integration.dto.RealTimeMonitoringBehaviorInstructionDto;
import cn.hutool.core.collection.CollectionUtil;
import com.wicket.okrcomponent.integration.dto.JudgeIsInrealTimePushTopicMsgNumComRespDto;
import com.wicket.okrcomponent.integration.dto.JudgeIsInrealTimePushTopicMsgNumComReqDto;
import com.wicket.okrframework.integration.FwBaseRoleClient;
import com.wicket.okrframework.integration.dto.QueryRoleOfPowerListComRespDto;
import com.wicket.okrframework.integration.dto.QueryRoleOfPowerListComReqDto;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Api(value = "User", tags = {"User"})
@RestController
// @RequestMapping("/oms/user/")
public class UserController {

    @Autowired
    UserService userService;

    /**
   * 登录
   * gen by moon at 8/17/2022, 7:39:27 PM
   */
    @PostMapping("/oms/user/login")
    @ApiOperation(value = "登录", response = OkrResult.class)
    public OkrResult<BffLoginRespDto> login(@RequestBody(required=false) @Validated BffLoginReqDto reqDTO){
        return OkrResult.success(userService.login(reqDTO));
    }

    /**
   * B1-切换公共信息
   * gen by moon at 8/10/2022, 3:36:23 AM
   */
    @PostMapping("/oms/user/changePublicInfo")
    @ApiOperation(value = "B1-切换公共信息", response = OkrResult.class)
    public OkrResult<BffChangePublicInfoRespDto> changePublicInfo(@RequestBody(required=false) @Validated BffChangePublicInfoReqDto reqDTO){
        return OkrResult.success(userService.changePublicInfo(reqDTO));
    }



    /**
   * B1-2换绑手机号
   * gen by moon at 8/10/2022, 3:29:26 AM
   */
    @PostMapping("/oms/user/updateChangePhone")
    @ApiOperation(value = "B1-2换绑手机号", response = OkrResult.class)
    public OkrResult<BffUpdateChangePhoneRespDto> updateChangePhone(@RequestBody(required=false) @Validated BffUpdateChangePhoneReqDto reqDTO){
        return OkrResult.success(userService.updateChangePhone(reqDTO));
    }

    /**
   * B1-2退出登录
   * gen by moon at 8/10/2022, 3:29:22 AM
   */
    @PostMapping("/oms/user/logout")
    @ApiOperation(value = "B1-2退出登录", response = OkrResult.class)
    public OkrResult<BffLogoutRespDto> logout(@RequestBody(required=false) @Validated BffLogoutReqDto reqDTO){
        return OkrResult.success(userService.logout(reqDTO));
    }

    /**
   * B1-2修改个人资料
   * gen by moon at 8/10/2022, 3:29:18 AM
   */
    @PostMapping("/oms/user/updateUserInfo")
    @ApiOperation(value = "B1-2修改个人资料", response = OkrResult.class)
    public OkrResult<BffUpdateUserInfoRespDto> updateUserInfo(@RequestBody(required=false) @Validated BffUpdateUserInfoReqDto reqDTO){
        return OkrResult.success(userService.updateUserInfo(reqDTO));
    }

    /**
   * B1-2查询账号安全信息列表
   * gen by moon at 8/10/2022, 3:31:50 AM
   */
    @PostMapping("/oms/user/queryAccountSecurityList")
    @ApiOperation(value = "B1-2查询账号安全信息列表", response = OkrResult.class)
    public OkrResult<BffQueryAccountSecurityListRespDto> queryAccountSecurityList(@RequestBody(required=false) @Validated BffQueryAccountSecurityListReqDto reqDTO){
        return OkrResult.success(userService.queryAccountSecurityList(reqDTO));
    }

    /**
   * B1-2首次登录完善个人资料
   * gen by moon at 9/7/2022, 1:49:03 AM
   */
    @PostMapping("/oms/user/updateRenewUserInfo")
    @ApiOperation(value = "B1-2首次登录完善个人资料", response = OkrResult.class)
    public OkrResult<BffUpdateRenewUserInfoRespDto> updateRenewUserInfo(@RequestBody(required=false) @Validated BffUpdateRenewUserInfoReqDto reqDTO){
        return OkrResult.success(userService.updateRenewUserInfo(reqDTO));
    }

    /**
   * B1-2查询个人信息详情
   * gen by moon at 8/10/2022, 3:29:13 AM
   */
    @PostMapping("/oms/user/queryPersonalInformationDetail")
    @ApiOperation(value = "B1-2查询个人信息详情", response = OkrResult.class)
    public OkrResult<BffQueryPersonalInformationDetailRespDto> queryPersonalInformationDetail(@RequestBody(required=false) @Validated BffQueryPersonalInformationDetailReqDto reqDTO){
        return OkrResult.success(userService.queryPersonalInformationDetail(reqDTO));
    }
/**
   * B1-查询用户登录信息（非Redis）
   * gen by moon at 9/29/2022, 3:50:52 PM
   */
    @PostMapping("/oms/user/queryUserInfoByLoginDetail")
    @ApiOperation(value = "B1-查询用户登录信息（非Redis）", response = OkrResult.class)
    public OkrResult<BffQueryUserInfoByLoginDetailRespDto> queryUserInfoByLoginDetail(@RequestBody(required=false) @Validated BffQueryUserInfoByLoginDetailReqDto reqDTO){
        return OkrResult.success(userService.queryUserInfoByLoginDetail(reqDTO));
    }
/**
   * 登录V2
   * gen by moon at 9/30/2022, 3:37:37 PM
   */
    @PostMapping("/oms/user/logUserIn")
    @ApiOperation(value = "登录V2", response = OkrResult.class)
    public OkrResult<BffLogUserinRespDto> LogUserin(@RequestBody(required=false) @Validated BffLogUserinReqDto reqDTO){
        return OkrResult.success(userService.LogUserin(reqDTO));
    }
/**
   * B1-2查询个人密保问题详情
   * gen by moon at 9/7/2022, 3:58:51 PM
   */
    @PostMapping("/oms/user/queryUserPwdProblemDetail")
    @ApiOperation(value = "B1-2查询个人密保问题详情", response = OkrResult.class)
    public OkrResult<BffQueryUserPwdProblemDetailRespDto> queryUserPwdProblemDetail(@RequestBody(required=false) @Validated BffQueryUserPwdProblemDetailReqDto reqDTO){
        return OkrResult.success(userService.queryUserPwdProblemDetail(reqDTO));
    }
/**
   * B1-2查询密保问题详情
   * gen by moon at 5/21/2023, 10:22:35 PM
   */
    @PostMapping("/oms/user/queryPwdProblemDetail")
    @ApiOperation(value = "B1-2查询密保问题详情", response = OkrResult.class)
    public OkrResult<BffQueryPwdProblemDetailRespDto> queryPwdProblemDetail(@RequestBody(required=false) @Validated BffQueryPwdProblemDetailReqDto reqDTO){
        return OkrResult.success(userService.queryPwdProblemDetail(reqDTO));
    }
/**
   * B1查询个人资料详情(公共)
   * gen by moon at 6/1/2023, 2:52:17 AM
   */
    @PostMapping("/oms/user/queryUserInfoDetailCom")
    @ApiOperation(value = "B1查询个人资料详情(公共)", response = OkrResult.class)
    public OkrResult<BffQueryUserInfoDetailComRespDto> queryUserInfoDetailCom(@RequestBody(required=false) @Validated BffQueryUserInfoDetailComReqDto reqDTO){
        return OkrResult.success(userService.queryUserInfoDetailCom(reqDTO));
    }
/**
   * 登录V3
   * gen by moon at 9/12/2023, 8:12:59 PM
   */
    @PostMapping("/oms/user/implementLogin")
    @ApiOperation(value = "登录V3", response = OkrResult.class)
    public OkrResult<BffImplementLoginRespDto> implementLogin(@RequestBody(required=false) @Validated BffImplementLoginReqDto reqDTO){
        return OkrResult.success(userService.implementLogin(reqDTO));
    }
/**
   * B1查询获取统一认证登录信息详情
   * gen by moon at 12/21/2023, 12:58:07 AM
   */
    @PostMapping("/oms/user/queryObtainUnifiedAuthenticationLoginInformationDetail")
    @ApiOperation(value = "B1查询获取统一认证登录信息详情", response = OkrResult.class)
    public OkrResult<BffQueryObtainUnifiedAuthenticationLoginInformationDetailRespDto> queryObtainUnifiedAuthenticationLoginInformationDetail(@RequestBody(required=false) @Validated BffQueryObtainUnifiedAuthenticationLoginInformationDetailReqDto reqDTO){
        return OkrResult.success(userService.queryObtainUnifiedAuthenticationLoginInformationDetail(reqDTO));
    }
/**
   * B1-执行第三方退出登录
   * gen by moon at 12/23/2023, 1:50:08 AM
   */
    @PostMapping("/oms/user/implementThirdPartyLoginOut")
    @ApiOperation(value = "B1-执行第三方退出登录", response = OkrResult.class)
    public OkrResult<BffImplementThirdPartyLoginOutRespDto> implementThirdPartyLoginOut(@RequestBody(required=false) @Validated BffImplementThirdPartyLoginOutReqDto reqDTO){
        return OkrResult.success(userService.implementThirdPartyLoginOut(reqDTO));
    }
}
